<template>
	<statusbar-item tooltip="打开新文档" @click="openNewFile">
		<i class="iconfont icon-statusbar-new_document center"></i>
	</statusbar-item>
</template>

<script setup lang="ts">
import { API } from '@v/utils/API';
import { createWindow } from '@v/utils/ipc';
import statusbarItem from '@v/components/statusbar/statusbarItem/index.vue';

function openNewFile() {
	API.invoke('select-md-file', '打开新文档').then((paths) => {
		if (paths) {
			createWindow(paths);
		}
	});
}
</script>
